<?php
/**
 * Class Application_Model_GalleryAlbums
 */

class Application_Model_GalleryAlbums extends Application_Model_ModelAbstract
{
    public $album_id    = null;
    public $album_title = '';
    public $album_icon  = '';

    /**
     * @param null $album_icon
     */
    public function setAlbumIcon($album_icon)
    {
        $this->album_icon = $album_icon;
    }

    /**
     * @return null
     */
    public function getAlbumIcon()
    {
        return $this->album_icon;
    }

    /**
     * @param null $album_id
     */
    public function setAlbumId($album_id)
    {
        $this->album_id = $album_id;
    }

    /**
     * @return null
     */
    public function getAlbumId()
    {
        return $this->album_id;
    }

    public function getId()
    {
        return $this->album_id;
    }

    /**
     * @param null $album_title
     */
    public function setAlbumTitle($album_title)
    {
        $this->album_title = $album_title;
    }

    /**
     * @return null
     */
    public function getAlbumTitle()
    {
        return $this->album_title;
    }

    /**
     * @return null
     */
    public function getTitle()
    {
        return $this->album_title;
    }

    public function getPhotos()
    {
        if (!$this->getAlbumId()) {
            return array();
        }

        $mapper = new Application_Model_Mapper(new Application_Model_DbTable_Gallery(), new Application_Model_Photo());
        return $mapper->getCollection(array('album_id' => $this->getAlbumId()), 'photo_id DESC');
    }

}